|
ARD2
RC2
Airbag Reference Demonstrator using MPC5604P
|
00001 00016 #include "derivative.h" 00017 #include "Compile_Options.h" 00018 #include "SystemTest.h" 00019 #include "SM.h" 00020 #include "SBC_AL.h" 00021 #include "HAL.h" 00022 #include "MailScheduler.h" 00023 #include "Application_Globals.h" 00024 #include "SIU.h" 00025 /* 00026 ****************************************************************************** 00027 * Constants 00028 ****************************************************************************** 00029 */ 00031 const uint16_t cau16PreSysTestValidStates[] = 00032 { 00033 SM_STATE_ERROR, SM_STATE_DEPLOYMENT }; 00034 /* 00035 ****************************************************************************** 00036 * Globals 00037 ****************************************************************************** 00038 */ 00039 /* 00040 ****************************************************************************** 00041 * u32fnStateSystemTest 00042 ****************************************************************************** 00043 */ 00044 uint32_t u32fnStateSystemTest(void) 00045 { 00046 uint32_t u32Status; 00047 00048 /* Verify that we can execute - Previous state ended correctly */ 00049 u32Status 00050 = u32fnSMValidateCurrentState((uint16_t*)cau16PreSysTestValidStates, 00051 N_ELEMENTS(cau16PreSysTestValidStates)); 00052 if(CLEAR == u32Status) 00053 { 00054 /* Here comes the real contents of the state */ 00055 LOCK_STATE_EXECUTION(); 00056 00057 00058 /* Unlock the state */ 00059 UNLOCK_STATE_EXECUTION(); 00060 } 00061 else 00062 { 00063 /* Leave */ 00064 } 00065 00066 /* Set the next state */ 00067 if(CLEAR == u32Status) 00068 { 00069 vfnSMWriteNextState(SM_APPLICATION_START); 00070 } 00071 else 00072 { 00073 vfnSMWriteNextState(SM_STATE_ERROR); 00074 } 00075 return (u32Status); 00076 } 00077 /* 00078 ****************************************************************************** 00079 * 00080 * End of file. 00081 * 00082 ****************************************************************************** 00083 */